<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

//管理后台
Route::group('admin', function () {
    Route::get('captcha', function () {
        $code = \edward\captcha\facade\CaptchaApi::create();
        return success([
            'uuid'=>$code['key'],
            'img'=>$code['base64']
        ]);
    });
    //管理员登陆
    Route::post('login', 'Login/login');
    //管理员登出
    Route::post('logout', 'Admin/logout');
    //获取用户信息
    Route::get('getInfo', 'Admin/getInfo');
    //获取用户信息
    Route::get('getRouters', 'Permission/getRouter');

    Route::rule('/', function () {
        return '管理后台首页';
    });
})->prefix('admin.')->middleware(\app\middleware\admin\Admin::class, \app\middleware\admin\CheckPermission::class);



Route::rule('/', function () {
    return '首页';
});
